import i18n from "i18next";
import { initReactI18next } from "react-i18next";

import translationEn from "./../assets/locales/en/translation.json";
import translationFa from "./../assets/locales/fa/translation.json";

export const DEFAULT_LOCALE = "en";

const resources = {
  en: translationEn,
  fa: translationFa,
};

i18n.use(initReactI18next).init({
  resources,
  lng: DEFAULT_LOCALE,
  fallbackLng: "en",
  debug: true,

  interpolation: {
    escapeValue: false, // react already safes from xss
  },
});

export default i18n;
